Implement RTL flipping for GtkAlignment. (#127585)
authorMatthias Clasen <maclas@gmx.de>
Sat, 6 Dec 2003 00:41:38 +0000 (00:41 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sat, 6 Dec 2003 00:41:38 +0000 (00:41 +0000)
Sat Dec  6 01:42:04 2003  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkalignment.c (gtk_alignment_size_allocate): Implement
RTL flipping for GtkAlignment.  (#127585)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkalignment.c

index b7dfc3da7e3c15074b3085686c1dad40881f3218..02ac540090c6394c235d92423afd4a26bff61200 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Dec  6 01:42:04 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkalignment.c (gtk_alignment_size_allocate): Implement
+       RTL flipping for GtkAlignment.  (#127585)
+
 Sat Dec  6 01:13:09 2003  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombo.c (gtk_combo_get_pos): Fix the position of the 
index b7dfc3da7e3c15074b3085686c1dad40881f3218..02ac540090c6394c235d92423afd4a26bff61200 100644 (file)
@@ -1,3 +1,8 @@
+Sat Dec  6 01:42:04 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkalignment.c (gtk_alignment_size_allocate): Implement
+       RTL flipping for GtkAlignment.  (#127585)
+
 Sat Dec  6 01:13:09 2003  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombo.c (gtk_combo_get_pos): Fix the position of the 
index b7dfc3da7e3c15074b3085686c1dad40881f3218..02ac540090c6394c235d92423afd4a26bff61200 100644 (file)
@@ -1,3 +1,8 @@
+Sat Dec  6 01:42:04 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkalignment.c (gtk_alignment_size_allocate): Implement
+       RTL flipping for GtkAlignment.  (#127585)
+
 Sat Dec  6 01:13:09 2003  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombo.c (gtk_combo_get_pos): Fix the position of the 
index b7dfc3da7e3c15074b3085686c1dad40881f3218..02ac540090c6394c235d92423afd4a26bff61200 100644 (file)
@@ -1,3 +1,8 @@
+Sat Dec  6 01:42:04 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkalignment.c (gtk_alignment_size_allocate): Implement
+       RTL flipping for GtkAlignment.  (#127585)
+
 Sat Dec  6 01:13:09 2003  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombo.c (gtk_combo_get_pos): Fix the position of the 
index b7dfc3da7e3c15074b3085686c1dad40881f3218..02ac540090c6394c235d92423afd4a26bff61200 100644 (file)
@@ -1,3 +1,8 @@
+Sat Dec  6 01:42:04 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkalignment.c (gtk_alignment_size_allocate): Implement
+       RTL flipping for GtkAlignment.  (#127585)
+
 Sat Dec  6 01:13:09 2003  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtkcombo.c (gtk_combo_get_pos): Fix the position of the 
index 2751895954916f24208063d4ab3079f6d9011ffa..785fb32c6ef7c370cf4c7c8191139bbc8e193271 100644 (file)
@@ -476,7 +476,7 @@ gtk_alignment_size_allocate (GtkWidget     *widget,
   gint border_width;
   gint padding_horizontal, padding_vertical;
   GtkAlignmentPrivate *priv;
-  
+  gfloat xalign;
 
   padding_horizontal = 0;
   padding_vertical = 0;
@@ -512,7 +512,11 @@ gtk_alignment_size_allocate (GtkWidget     *widget,
       else
        child_allocation.height = height;
 
-      child_allocation.x = alignment->xalign * (width - child_allocation.width) + allocation->x + border_width + priv->padding_left;
+      xalign = alignment->xalign;
+      if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+       xalign = 1.0 - xalign;
+
+      child_allocation.x = xalign * (width - child_allocation.width) + allocation->x + border_width + priv->padding_left;
       child_allocation.y = alignment->yalign * (height - child_allocation.height) + allocation->y + border_width + priv->padding_top;
 
       gtk_widget_size_allocate (bin->child, &child_allocation);